{{!--
  Original work Copyright (c) 2015 Nils Knappmeier
  https://github.com/bootprint/bootprint-openapi

  Renders the parameter table within a operation definition.
  @param {Array<Parameter>|Object<Parameter>} parameters a list of Swagger-Parameter objects
     If this is an object, an it is expected to be the global parameter list
     https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#parametersDefinitionsObject
     and the key of each entry is display in a column in front of the other columns.
  @api public
--}}

{{#if parameters}}
  <section class="swagger-request-params">
    {{#each parameters}}
      {{#schemaReferenceContext $ref}}
        <div class="prop-row prop-group">
          <div class="prop-name">
            <div class="prop-title">{{name}}: <span class="prop-type">{{~>json-schema/datatype . ~}}</span></div>
            {{#if required}}
              <span class="json-property-required"></span>
            {{/if}}
            <div class="prop-subtitle">
              in {{in}}
            </div>
            {{!--
            {{#if schema.$ref}}
              <span class="swagger-global"></span> <span class="json-schema-reference"><a href="{{$ref}}">{{$ref}}</a></span>
            {{/if}}
            --}}
          </div>
          <div class="prop-value">
            {{>swagger/description description}}
          </div>
        </div>
        {{! parameter `collectionFormat` field }}
        {{~#if collectionFormat ~}}
          <div class="prop-row prop-inner">
            {{md (swaggerCollectionFormat collectionFormat name) stripParagraph=true}}
          </div>
        {{~/if}}
      {{/schemaReferenceContext}}
    {{/each}}
  </section>
{{/if}}
